<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <!-- 必要的标签 -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link crossorigin="anonymous" integrity="sha512-6KY5s6UI5J7SVYuZB4S/CZMyPylqyyNZco376NM2Z8Sb8OxEdp02e1jkKk/wZxIEmjQ6DRCEBhni+gpr9c4tvA==" href="https://lib.baomitu.com/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
        h3{
            text-align: center;
            text-decoration: darkgray;
        }

        .container{
            border-color: rgba(31,40,214,0.1);
            background-color: rgba(109,88,92,0.1);
            border-radius: 10px;
        }

    </style>
</head>
<body>

<nav th:replace="aim::navbar"></nav>
<div class="container">
    <br>
    <h3>学生目录</h3>
    <hr>
    <!--新增学生按钮-->
    <a th:href="@{/students/new}" href="#" class="btn btn-primary btn-sm mb-3">新增学生</a>
    <br>
    <table class="table table-bordered table-striped">
        <thead class="thead-dark">
        <tr>
            <th>学生姓名</th>
            <th>学生学号</th>
            <th>学生性别</th>
            <th>所属学院</th>
            <th>专业</th>
            <th>电话</th>
            <th>功能</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="students : ${student}">
            <td th:text="${students.name}"></td>
            <td th:text="${students.ID}"></td>
            <td th:text="${students.sex}"></td>
            <td th:text="${students.collage}"></td>
            <td th:text="${students.major}"></td>
            <td th:text="${students.call}"></td>
            <td>
                <a th:href="@{students/update(id=${students.ID})}" class="btn btn-info btn-sm">更新</a>
                <a th:href="@{students/delete(id=${students.ID})}"
                   class="btn btn-info btn-sm"
                   onclick="if (!(confirm('是否删除？？？'))) return false"
                >删除</a>
                <a th:href="@{students/selete(id=${students.ID})}" class="btn btn-info btn-sm">查询</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>

</body>
</html>